
val productInfoDF=spark.read.option("header","true" ).csv("product_info.csv").createOrReplaceTempView("product_info")
salesDF.createOrReplaceTempView("sales")
val joinedDF = spark.sql("""
    SELECT s.Product, p.Category, SUM(s.Quantity) as TotalUnitsSold
    FROM sales s
    JOIN product_info p ON s.Product = p.Product
    GROUP BY s.Product, p.Category
""")
joinedDF.show()
